/**
 * Emulated extension enum
 * 扩展的枚举
 */
public enum  ExtendOperationImpl implements IOperation {
    // 求幂
    EXP("^") {
        @Override
        public double apply(double x, double y) {
            return Math.pow(x ,y);
        }
    },
    // 求余
    REMAINDER("%"){
        @Override
        public double apply(double x, double y) {
            return x % y;
        }
    };


    private final String symbol;

    ExtendOperationImpl(String symbol) {
        this.symbol = symbol;
    }

    @Override
    public String toString() {
        return symbol;
    }
}
